<aside class="layui-col-md4">
    <!-- 分类目录 -->
    @if ($cats)
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">分类目录</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space15">
                        @foreach($cats as $cat)
                        <div class="layui-col-sm6">
                            <a href="{{$cat->link}}" title="{{$cat->name}}" class="layui-btn layui-btn-primary" style="width: 100%;">{{$cat->name}}（{{$cat->count}}）</a>
                        </div>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    @endif
    <!-- 搜索 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-panel" style="padding: 10px;">
                <div class="layui-form">
                    <div class="layui-inline" style="width: calc(100% - 95px);">
                        <input type="text" name="search" required lay-verify="required" placeholder="搜索..." class="layui-input">
                    </div>
                    <button class="layui-btn search-btn"><i class="layui-icon layui-icon-search"></i> 搜索</button>
                </div>
            </div>
        </div>
    </div>
    <br />
    <!-- 标签 -->
    @if ($tags)
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">标签</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-btn-container">
                                @foreach($tags as $t => $tag)
                                <a href="{{$tag->link}}" rel="nofollow" title="{{$tag->name}} 共 {{$tag->count}} 篇文章" class="layui-btn layui-btn-radius{{$t % 4 === 1 ? ' layui-btn-normal' : ($t % 4 === 2 ? ' layui-btn-warm' : ($t % 4 === 3 ? ' layui-btn-danger' : ''))}} layui-btn-sm">{{$tag->name}}（{{$tag->count}}）</a>
                                @endforeach
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    @endif
    <!-- 热门文章 -->
    @if ($hots)
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">热门文章</div>
                <div class="layui-card-body">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-panel">
                                <ul class="layui-menu">
                                    @foreach($hots as $h => $hot)
                                    <li>
                                        <div class="layui-menu-body-title">
                                            <i class="layui-icon layui-icon-right"></i><a href="{{$hot->link}}" title="{{$hot->title}}"><span class="layui-badge-dot{{isset($article->id) && $article->id === $hot->id ? '' : ' layui-bg-black'}}"></span> &nbsp;{{$hot->title}}</a>
                                        </div>
                                    </li>
                                    @if ($h !== count($hots) - 1)
                                    <li class="layui-menu-item-divider"></li>
                                    @endif
                                    @endforeach
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    @endif
</aside>